<html>
<head><title>BookBurrito Options</title>
<link rel="stylesheet" href="options.css" />
<script src="../libs/jquery.min.js"></script>
<script src="../libs/jquery-ui.min.js"></script>
<script src="../libs/uuid.js"></script>
<script src="../libs/typewatch.js"></script>
<script src="../modules/tabs.js"></script>
<script src="../modules/prefs.js"></script>
<script src="../modules/database.js"></script>
<script src="../data/stores.js"></script>
<script src="../modules/isbn.js"></script>
<script src="../modules/sites.js"></script>
<script src="../modules/bb.js"></script>
<script src="../modules/options.js"></script>

</head>

<body>
<div class="contents" id="options">
<div class="header">
BookBurrito Options
</div>
<form class="optionsForm">
<div class="tab-control">
	<ul class="tabs">
		<li><a href="#libraries-tab">Libraries</a></li>
		<li><a href="#advanced-tab">Custom</a></li>
		<li><a href="#stores-tab">Book Stores</a></li>
		<li><a href="#worldcat-tab" style='display: none'>WorldCat</a></li>
		<li><a href="#affiliate">Affiliate Codes</a></li>
		<li><a href="#about-tab">About</a></li>
	</ul>

<div id="libraries-tab">
<p>
Select libraries to be listed by BookBurrito:
</p>
<div id="libraries" class="ajax"></div>
<div class="info"><span class="validated">Verified by BookBurrito</span><span class="community">Contributed by User Community <small>(Use at own risk)</small></span></div>
</div>

<div id="stores-tab">
<div id="stores"></div>
</div>


<div id="advanced-tab">
<p>
Use this page to configure libraries that do not yet exist in the official or community BookBurrito library
database.
</p>

<div id="custom">
<div id="custom-table" style="display: none">
<table class="matrix">
<thead>
<tr><th style="width: 100%">Custom Libraries</th><th>&nbsp;</th></tr>
</thead>
<tbody>
</tbody>
</table>
<p>
Please consider contributing your custom library configuration to the BookBurrito database.
</p>
</div>

<button id="add_custom">Add Custom Library</button>

</div>

<div id="custom-form">

<h3>Custom Library Configuration</h3>

<input id="custom-name" name="name" value="" style="display:none"/>

<div class="field">
<label for="custom-title">Library Title:
<span class="tip">Dislayed in the BookBurrito listing</span>
</label>
<input id="custom-title" name="title" value="DC - Library of Congress" />
</div>

<div class="field">
<label for="custom-link">Link:
<span class="tip">URL to library catalog query (must contain #{ISBN} replacement token)</span>
</label>
<input id="custom-link" name="link" value="http://www.loc.gov/search/?q=#{ISBN}&amp;fa=digitized:false"/>
</div>

<div class="field">
<label>Search Results Interpretation:</label>
</div>

<div class="field">
<input type="radio" id="custom-match_missing" name="search_results" style="width: auto" checked="checked"/>
<label for="custom-match_missing" style="display: inline; font-weight: normal">
Missing Text
<span class="tip">Text returned by unsuccessful catalog query contains the following text:</span>
</label>
</div>

<div class="field" id="field-missing" style="padding-left: 1.5em">
<input id="custom-missing" name="missing" value="We did not find any matches for this search." />
</div>

<div class="field">
<input type="radio" id="custom-match_isbn" name="search_results" style="width: auto"/>
<label for="custom-match_isbn" style="display: inline; font-weight: normal">
Match ISBN in results
<span class="tip">Text returned by successful catalog query contains the ISBN</span>
</label>
</div>

<div class="field">
<label for="custom-have">Existing Book:
<span class="tip">ISBN of a book that exists in the library catalog</span>
</label>
<input id="custom-have" name="have" value="0814474268"/>
</div>

<div class="field">
<label for="custom-dont">Missing Book:
<span class="tip">ISBN of a book that does <b>not</b> exist in the library catalog</span>
</label>
<input id="custom-dont" name="dont" value="0373691122" />
</div>

<pre class="test-results"></pre>

<div class="buttons">
<button id="custom-test">Test</button>
<button id="custom-save">Done</button>
<button id="custom-cancel">Cancel</button>
</div>
</div>

</div>


<div id="worldcat-tab">
<p>
WorldCat is a worldwide union catalog created and maintained collectively by its member institutions.
With millions of online records built from the bibliographic and ownership information of contributing
libraries, it is the largest and most comprehensive database of its kind.
</p>
<p>
By specifying your location, BookBurrito will link you to the WorldCat search results page of
libaries near you.
</p>
<p>
<label for="worldcat">
Your location (postal code, state, province or country)<br/>
<input id="worldcat" type="text" /></label>
</p>
</div>


<div id="affiliate">
<p>
By default BookBurrito uses affiliate codes when it creates links to stores that support them.
These help support the further development of BookBurrito.
If you wish, you may disable affiliate codes.
</p>
<p>
<label for="no-affiliate-codes"><input id="no-affiliate-codes" type="checkbox" /> Disable Affiliate Codes</label>
</p>
</div>


<div id="about-tab">
<p>
Version: <script>document.write(BB.version)</script>
</p>
<p>
BookBurrito is an extension for the Google Chrome browser.  When it senses your are looking at
a page that contains a book, it will overlay a small panel which when opened lists prices at
online bookstores such as Amazon and whether the book is available at your library.
</p>
<p>
For more information, please visit <a href="http://bookburrito.org">BookBurrito.org</a>.
</p>
</div>

<p>
<button id="save">Save Settings</button>
<button id="cancel">Revert Settings</button>
</p>

</div>

</form>

</div>

<form id="shared-form" method="POST" target="_blank" class="hidden">
</form>

</body>
</html>